using System;
using System.Collections.Generic;
using System.Text;

namespace tKitchen
{
    public class Unit
    {
        int unitId;
        string name;
        string abbrev;
        string descr;

        //Type type //type of measurement: volume, weight. Used for conversions 

        #region Properties
        public int UnitId
        {
            get { return unitId; }
            set { unitId = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public string Abbrev
        {
            get { return abbrev; }
            set { abbrev = value; }
        }


        public string Descr
        {
            get { return descr; }
            set { descr = value; }
        }
        #endregion


        public Unit(UnitPO unitPOIn)
        {
            unitId = unitPOIn.UnitId;
            name = unitPOIn.Name;
            abbrev = unitPOIn.Abbrev;
            descr = unitPOIn.Descr;

        }

        public Unit()
        {
        }

        public Unit(int idIn, string nameIn, string abbrevIn, string descIn)
        {
            unitId = idIn;
            name = nameIn;
            abbrev = abbrevIn;
            descr = descIn;

        }

        public override string ToString()
        {
            return this.name;
        }


        internal Unit Copy()
        {
            Unit temp = new Unit();
            temp.Abbrev = this.Abbrev;
            temp.Descr = this.Descr;
            temp.Name = this.Name;
            temp.UnitId = this.UnitId;

            return temp;
        }
    }
}
